<template>
  <starTwoView :title="lang.title" :left="8" :right="16">
    <div slot="left" style="background: red;height:2000px;">abc</div>
    <cfg-form-list slot="right">
      <cfg-title v-bind="config.title"></cfg-title>
      <cfg-form :onlyRead="onlyRead" v-bind="config.section.start" :data="data"></cfg-form>
      <cfg-subtitle :title="'投料:'"></cfg-subtitle>
      <cfg-form :onlyRead="onlyRead" style="border:1px solid #dcdee2;padding-top: 10px;" v-bind="config.section.feed" :data="data.feed"></cfg-form>
      <cfg-subtitle :title="'产物:'"></cfg-subtitle>
      <cfg-form :onlyRead="onlyRead" style="border:1px solid #dcdee2;padding-top: 10px;" v-bind="config.section.product" :data="data.product"></cfg-form>
      <cfg-subtitle :title="'记录:'"></cfg-subtitle>
      <cfg-sheet :onlyRead="onlyRead" v-bind="config.section.records" :data="data.records"></cfg-sheet>
      <Button type="primary" long @click="data.records.push({})">加一行</Button>
      <cfg-subtitle :title="'记事栏:'"></cfg-subtitle>
      <cfg-form :onlyRead="onlyRead" v-bind="config.section.comments" :data="data"></cfg-form>
    </cfg-form-list>
  </starTwoView>
</template>

<script>
export default {
  name: "index",
  data(){
    return {
      onlyRead:false,
      config:{
        title:{
          title:'还 原 原 始 记 录',
          titleStyle:{},
          outlineStyle:{marginBottom:'20px'},
        },
        section:{
          start:{
            labelWidth:70,
            labelPosition:'right',
            cols:4,
            columns:[
              {title:'炉号:',key:'FurnaceNo',config:{type:'text'}},
              {title:'时间:',key:'date',config:{type:'date'}},
              {title:'班组:',key:'shift',config:{type:'select',options:[{label:1,value:1},{label:2,value:2},{label:1,value:3},]}},
              {title:'表单号:',key:'formNo',config:{type:'text'}},
            ],
            rules:{}
          },
          feed:{
            labelWidth:70,
            labelPosition:'right',
            cols:3,
            columns:[
              {title:'名称:',key:'name',config:{type:'text'}},
              {title:'批次:',key:'batchNo',config:{type:'text'}},
              {title:'重量:',key:'weight',config:{type:'number',}},
            ],
            rules:{}
          },
          product:{
            labelWidth:70,
            labelPosition:'right',
            cols:3,
            columns:[
              {title:'名称:',key:'name',config:{type:'text'}},
              {title:'批次:',key:'batchNo',config:{type:'text'}},
              {title:'重量:',key:'weight',config:{type:'number',}},
            ],
            rules:{}
          },
          records:{
            columns:[
              {title:'管号',align:'center',key:'pipeNo',config:{type:'text'}},
              {title:'温度 <br/>（摄氏）',align:'center',children:[
                  {title:'一带',align:'center',key:'temperature1',config:{type:'text'}},
                  {title:'二带',align:'center',key:'temperature2',config:{type:'text'}},
                  {title:'三带',align:'center',key:'temperature3',config:{type:'text'}},
                  {title:'四带',align:'center',key:'temperature4',config:{type:'text'}},
                  {title:'五带',align:'center',key:'temperature5',config:{type:'text'}},
                ]},
              {title:'时间',align:'center',key:'time',config:{type:'time'}},
              {title:'装舟量<br/>(kg/舟)',align:'center',key:'weight',config:{type:'number'}},
              {title:'推速<br/>(分/舟)',align:'center',key:'speed',config:{type:'number'}},
              {title:'氢流量<br/>(m3/h)',align:'center',key:'HWeight',config:{type:'number'}},
            ]
          },
          comments:{
            labelWidth:0,
            labelPosition:'right',
            cols:1,
            columns:[
              {title:'',key:'name',config:{type:'textarea'}},
            ],
            rules:{}
          },
        }
      },
    }
  },
  props:{
    data:{
      default:()=>{
        return {
          FurnaceNo:'',
          date:null,
          shift:'',
          formNo:'HM-AH038-A',
          feed:{
            name:'',
            batchNo:'',
            weight:0
          },
          product:{
            name:'',
            batchNo:'',
            weight:0
          },
          records:[
            {
              pipeNo:'abc',
              temperature1:'',
              temperature2:'',
              temperature3:'',
              temperature4:'',
              temperature5:'',
              time:'',
              weight:0,
              speed:0,
              HWeight:0
            }
          ],
          comments:''
        }
      }
    }
  },
  computed:{
    lang(){
      return {
        'zh-CN':{
          title:'两列页面',
        },
        'en-US':{
          title:'two column'
        }
      }[this.G_Locale]
    }
  }
}
</script>

<style lang="scss" scoped>

</style>